(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    ["pages/main/sales/my"], {
        "0a92": function (e, t, n) {
            "use strict";
            (function (e, t) {
                var o = n("4ea4");
                n("c150"), n("5c17"), n("a9ff");
                o(n("66fd"));
                var a = o(n("cd41"));
                e.__webpack_require_UNI_MP_PLUGIN__ = n, t(a.default)
            }).call(this, n("bc2e")["default"], n("543d")["createPage"])
        },
        "0dae": function (e, t, n) {
            "use strict";
            n.r(t);
            var o = n("21d9"),
                a = n.n(o);
            for (var i in o)["default"].indexOf(i) < 0 && function (e) {
                n.d(t, e, (function () {
                    return o[e]
                }))
            }(i);
            t["default"] = a.a
        },
        "21d9": function (e, t, n) {
            "use strict";
            (function (e) {
                var o = n("4ea4");
                Object.defineProperty(t, "__esModule", {
                    value: !0
                }), t.default = void 0;
                var a = o(n("2eee")),
                    i = o(n("c973")),
                    s = {
                        data: function () {
                            return {
                                model: {
                                    xsname: ""
                                },
                                roleKey: "",
                                url: getApp().globalData.apiurl,
                                username:getApp().globalData.userinfo.nickName,
                                state: 1,
                                current: 0,
                                items: ["已通过", "待处理", "已驳回", "未提交"],
                                loadingType: "more",
                                totalCount: 0,
                                totalPages: 1,
                                pageSize: 10,
                                pageIndex: 1,
                                listData: [],
                                scrollHeight: 0,
                                pageNum: 0
                            }
                        },
                        methods: {
                            downLoad: function (e) {
                                var t = this;
                                console.log(t.totalPages)
                                console.log(t.pageNum)
                                if (t.totalPages < t.pageNum) {
                                    this.getdata()
                                }
                            },
                            goToPointout: function (t, n) {
                                e.showToast({
                                    title: t,
                                    icon: n ? "success" : "error",
                                    duration: 2e3
                                })
                            },
                            deleteItem: function (t) {
                                var n = this;
                                wx.showModal({
                                    title: '提示',
                                    content: '确认要删除该订单?',
                                    success: function (res) {
                                        if (res.confirm) {
                                            console.log('用户点击确定')
                                            e.request({
                                                url: n.url + "salesdocuments/salesdocuments/" + [t],
                                                method: "DELETE",
                                                success: function (a) {
                                                    let obj={salesdocumentsId:t,modifierCode:getApp().globalData.userinfo.userName,modifier:getApp().globalData.userinfo.nickName };
                                                    e.request({
                                                        url: n.url + "limit/limitManageLog/removedd",
                                                        method: "POST",
                                                        data: obj,
                                                        success: function (res) {
                              
                                                        }
                                                    })



                                                    return;
                                                    if (200 == e.data.code) {
                                                        wx.request({
                                                            url: n.url + 'driverorders/driverorders/list',
                                                            method: "GET",
                                                            data: {orderid:t},
                                                            success: res => {
                                                               console.log(res.data.rows);
                                                                for (let index = 0; index < res.data.rows.length; index++) {
                                                                    wx.request({
                                                                        url: n.url + "driverorders/driverorders/delByLicenseplate",
                                                                        method: "GET",
                                                                        data: {
                                                                            driverphone: res.data.rows[index].driverphone,
                                                                            drivername: res.data.rows[index].drivername,
                                                                            licenseplate: res.data.rows[index].licenseplate
                                                                        },
                                                                        success: function (res) {
                                                                           
                                                                            console.log(res);
                                                                        }
                                                                    })
                                                               }
                                                            }
                                                        })
                                                        n.goToPointout("删除成功！", !0);
                                                        return
                                                    } else{
                                                        n.goToPointout("删除失败！", !1)
                                                    }
                                                },
                                                fail: function () {
                                                    n.goToPointout("删除失败！", !1)
                                                },
                                                complete: function () {
                                                    n.submitForm()
                                                    // n.onClickItem({
                                                    //     currentIndex: 3
                                                    // })
                                                }
                                            })
                                        } else if (res.cancel) {
                                            console.log('用户点击取消')
                                        }
                                    }
                                })
                            },
                            loadData: function () {
                                var e = arguments,
                                    t = this;
                                return (0, i.default)(a.default.mark((function n() {
                                    return a.default.wrap((function (n) {
                                        while (1) switch (n.prev = n.next) {
                                            case 0:
                                                e.length > 0 && void 0 !== e[0] ? e[0] : "add", e.length > 1 ? e[1] : void 0, t;
                                            case 3:
                                            case "end":
                                                return n.stop()
                                        }
                                    }), n)
                                })))()
                            },
                            getdata: function () {
                                var n = this,
                                    o = (e.getStorageSync("key"), getApp().globalData.userinfo.roles[0].roleKey);
                                this.roleKey = o;
                                var a = getApp().globalData.userinfo.nickName;
                                e.request({
                                    url: this.url + "salesdocuments/salesdocuments/list",
                                    method: "GET",
                                    data: {
                                        createname: a,
                                        roles: o,
                                        pageNum: n.totalPages,
                                        pageSize: n.pageSize,
                                        operatorno:n.model.xsname
                                    },
                                    success: function (e) {
                                        console.log("查询")
                                        //n.listData = e.data.rows, console.log(n.listData)
                                        e.data.rows.forEach(item => {
                                            n.listData.push(item)
                                        });
                                        // t.listData = e.data.rows,
                                        n.totalPages = n.totalPages + 1
                                        console.log(n.listData)
                                    },
                                    fail: function () {},
                                    complete: function () {}
                                })
                            },
                            onClickItem: function (t) {
                                var n = this;
                                console.log(t), this.current != t.currentIndex && (this.current = t.currentIndex);
                                var o = 0;
                                0 == t.currentIndex && (this.state = 1, o = 1), 1 == t.currentIndex && (this.state = 0, o = 0), 2 == t.currentIndex && (this.state = 3, o = 3), 3 == t.currentIndex && (this.state = 4, o = 4), this.pageIndex = 1, this.loadingType = "", this.listData = [];
                                var a = [],
                                    i = (e.getStorageSync("key"), getApp().globalData.userinfo.roles[0].roleKey),
                                    s = getApp().globalData.userinfo.nickName;
                                console.log(o), e.request({
                                    url: this.url + "salesdocuments/salesdocuments/list",
                                    method: "GET",
                                    data: {
                                        createname: s,
                                        roles: i
                                    },
                                    success: function (e) {
                                        var t = e.data.rows;
                                        if (4 == o)
                                            for (var i = 0; i < t.length; i++) s == t[i].createname && a.push(t[i]);
                                        else a = t;
                                        if (null != n.model.xsname && void 0 != n.model.xsname && "" != n.model.xsname) {
                                            for (var u = 0; u < t.length; u++) t[u].createname == n.model.xsname && a.push(t[u]);
                                            n.listData = a
                                        } else n.listData = a
                                    },
                                    fail: function () {},
                                    complete: function () {}
                                })
                            },
                            goDetail: function (t) {
                                console.log("传到修改页的订单id", t), 4 == this.state ? e.navigateTo({
                                    url: "/pages/main/sales/create?id=".concat(t)
                                }) : e.navigateTo({
                                    url: "/pages/main/sales/orderDetails?id=".concat(t)
                                })
                            },
                            revise: function (t) {
                                console.log("跳转到修改页面");
                                e.redirectTo({
                                    url: "/pages/main/sales/create?id=".concat(t)
                                })
                            },
                            submitForm: function () {
                                var t = this;
                                console.log(this.model.xsname), this.pageIndex = 1, this.loadingType = "";
                                var n = [],
                                    o = (e.getStorageSync("key"), getApp().globalData.userinfo.roles[0].roleKey),
                                    a = getApp().globalData.userinfo.nickName;
                                e.request({
                                    url: this.url + "salesdocuments/salesdocuments/list",
                                    method: "GET",
                                    data: {
                                        createname: a,
                                        roles: o,
                                        operatorno:t.model.xsname
                                    },
                                    success: function (e) {
                                        // if (null != t.model.xsname && void 0 != t.model.xsname && "" != t.model.xsname) {
                                        //     for (var o = 0; o < e.data.rows.length; o++) e.data.rows[o].createname.includes( t.model.xsname) && n.push(e.data.rows[o]);
                                        //     t.listData = n
                                        // } else 
                                        t.listData = e.data.rows
                                    },
                                    fail: function () {},
                                    complete: function () {}
                                })
                            }
                        },
                        onLoad: function (t) {
                            var n = this,
                                o = (e.getStorageSync("key"), getApp().globalData.userinfo.roles[0].roleKey);
                            this.roleKey = o;
                            var a = getApp().globalData.userinfo.nickName;
                            e.request({
                                url: this.url + "salesdocuments/salesdocuments/list",
                                method: "GET",
                                data: {
                                    createname: a,
                                    roles: o,
                                    pageNum: n.totalPages,
                                    pageSize: n.pageSize
                                },
                                success: function (e) {
                                    console.log(e.data.rows)
                                        n.listData = e.data.rows,
                                        n.totalPages = n.totalPages + 1,
                                        n.pageNum = e.data.total / n.pageSize + 1;
                                },
                                fail: function () {},
                                complete: function () {}
                            })
                            wx.getSystemInfo({
                                success: function (res) {
                                    n.scrollHeight = res.windowHeight - 70
                                }
                            });
                        },
                        onPullDownRefresh: function () {
                            this.loadData("refresh")
                        },
                        onReachBottom: function () {
                            this.loadData("add")
                        }
                    };
                t.default = s
            }).call(this, n("543d")["default"])
        },
        3321: function (e, t, n) {
            "use strict";
            var o = n("fd66"),
                a = n.n(o);
            a.a
        },
        9036: function (e, t, n) {
            "use strict";
            n.d(t, "b", (function () {
                return a
            })), n.d(t, "c", (function () {
                return i
            })), n.d(t, "a", (function () {
                return o
            }));
            var o = {
                    uniSegmentedControl: function () {
                        return n.e("components/uni-segmented-control/uni-segmented-control").then(n.bind(null, "aaf7"))
                    },
                    uniForms: function () {
                        return Promise.all([n.e("common/vendor"), n.e("components/uni-forms/uni-forms")]).then(n.bind(null, "0933"))
                    },
                    uniFormsItem: function () {
                        return n.e("components/uni-forms-item/uni-forms-item").then(n.bind(null, "4828"))
                    },
                    uniEasyinput: function () {
                        return Promise.all([n.e("common/vendor"), n.e("components/uni-easyinput/uni-easyinput")]).then(n.bind(null, "5dad"))
                    },
                    uniSwipeAction: function () {
                        return n.e("components/uni-swipe-action/uni-swipe-action").then(n.bind(null, "e7b4"))
                    },
                    uniSwipeActionItem: function () {
                        return Promise.all([n.e("common/vendor"), n.e("components/uni-swipe-action-item/uni-swipe-action-item")]).then(n.bind(null, "c498"))
                    },
                    uniTag: function () {
                        return n.e("components/uni-tag/uni-tag").then(n.bind(null, "7fdd"))
                    },
                    uniLoadMore: function () {
                        return n.e("components/uni-load-more/uni-load-more").then(n.bind(null, "16c3"))
                    }
                },
                a = function () {
                    var e = this.$createElement;
                    this._self._c
                },
                i = []
        },
        cd41: function (e, t, n) {
            "use strict";
            n.r(t);
            var o = n("9036"),
                a = n("0dae");
            for (var i in a)["default"].indexOf(i) < 0 && function (e) {
                n.d(t, e, (function () {
                    return a[e]
                }))
            }(i);
            n("3321");
            var s = n("f0c5"),
                u = Object(s["a"])(a["default"], o["b"], o["c"], !1, null, "a79159ae", null, !1, o["a"], void 0);
            t["default"] = u.exports
        },
        fd66: function (e, t, n) {}
    },
    [
        ["0a92", "common/runtime", "common/vendor"]
    ]
]);